﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace AGif
{
    public class Header:Component
    {
        public enum GIFType
        {
            GIF89a
        };

        public GIFType Type { get; set; }

        public Header()
        {
            Type = GIFType.GIF89a;
        }

        public byte[] Save()
        {
            switch (Type)
            {
                default:
                case GIFType.GIF89a:
                    return ASCIIEncoding.ASCII.GetBytes("GIF89a");
                    break;
            }

        }

        public void Load(Stream reader)
        {
            byte[] bytes = new byte[6];

            reader.Read(bytes, 0, 6);

            string str = ASCIIEncoding.ASCII.GetString(bytes);

            switch (str)
            {
                default:
                case "GIF89a":
                    Type = GIFType.GIF89a;
                    break;
            }
        }
    }
}
